const express = require("express");
const router = express();
const config = require("./config");

const base_url = "http://" + config.IP + ":" + config.PORT + "/images/goods/";

router.post("/", (req, res) => {
    
    // var id = req.query.value;
    // console.log("req = " + req);
    console.log(`<-- categoryGoods -->`);

    var categoryGoods = {
        "code" : "0000",
        "message" : "success",
        "data" : [
            {
                "name": "能驾驭你的人，都是你心甘情愿，视如生命爱的人。",
                "image": base_url + "001/cover.jpg",
                "presentPrice": 98.88,
                "goodsId": "001",
                "oriPrice": 108.88
            },
            {
                "name": "恋爱有时是教育工作，费尽心力把那个人整理好了，然后把那个人交还给世界。",
                "image": base_url + "002/cover.jpg",
                "presentPrice": 229.90,
                "goodsId": "002",
                "oriPrice": 329.90
            },
            {
                "name": "人生是一场错过，愿你别蹉跎。",
                "image": base_url + "003/cover.jpg",
                "presentPrice": 318.88,
                "goodsId": "001",
                "oriPrice": 388.88
            },
            {
                "name": "幸福就是，早安后的早餐，到晚餐后的晚安，你都在。",
                "image": base_url + "004/cover.jpg",
                "presentPrice": 238.88,
                "goodsId": "001",
                "oriPrice": 258.88
            },
            {
                "name": "不要因为努力变成别人喜欢的样子，到头来忘了最真实的自己。",
                "image": base_url + "005/cover.jpg",
                "presentPrice": 312.00,
                "goodsId": "001",
                "oriPrice": 399.00
            },
            {
                "name": "人，要记事不能记仇，记事可以增长知识；记仇可以增加烦恼。",
                "image": base_url + "006/cover.jpg",
                "presentPrice": 99.99,
                "goodsId": "001",
                "oriPrice": 199.99
            },
            {
                "name": "我只有一个一生，不能慷慨赠给不爱的人。",
                "image": base_url + "007/cover.jpg",
                "presentPrice": 315.88,
                "goodsId": "001",
                "oriPrice": 355.88
            },
            {
                "name": "也许有些人，当你转头的时候，已经不再回头，轻舟已经划过了万重山。",
                "image": base_url + "008/cover.jpg",
                "presentPrice": 888.88,
                "goodsId": "001",
                "oriPrice": 999.99
            },
        ],
    };
    res.send(categoryGoods);
});

module.exports = router;